<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ include file="/common/taglibs.jsp"%>
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=Edge"/>
<title>影像审核详细信息</title>
<link rel="stylesheet" type="text/css" href="${ctx}/easyui/themes/default/easyui.css">
<link rel="stylesheet" type="text/css" href="${ctx}/easyui/easyui_my.css">
<link rel="stylesheet" type="text/css" href="${ctx}/easyui/themes/icon.css">
<link rel="stylesheet" type="text/css" href="${ctx}/css/css.css" />
<style type="text/css">
    .panel-title{ color: #444444;}
</style>
<script type="text/javascript" src="${ctx}/js/jquery-1.7.min.js"></script>
<script type="text/javascript" src="${ctx}/easyui/jquery.easyui.min.js"></script>
<script type="text/javascript" src="${ctx }/easyui/locale/easyui-lang-zh_CN.js"></script>
<script type="text/javascript" src="${ctx}/js/common.js"></script>

<script type="text/javascript" src="${ctx}/js/jqzoom.pack.1.0.1.js"></script>
<style type="text/css">
#wfdd_chzn{
 display: none;
}
img {
    vertical-align: top;
}
</style>

</head>
<body class="easyui-layout">
<form id="gclsForm">
<div data-options="region:'center',border:false,cls:'yujszhidongshibie'" style="overflow-y :hidden;padding: 7px;">
<div class="easyui-layout" data-options="fit:true">
	<div data-options="region:'north',border:false" style="height: 100px;">
			<table cellspacing="0" cellpadding="0" border="0" width="100%" class="dananguanglikuang">	     
				     	 <tr>
				             <th align="right" height="26">号牌号码：</th>
				             <td>
				                 <input type="text" id="hphmmc" name="hphmmc"  value="${list.hphmmc }">
				             </td>
				             <th align="right" height="26">车辆品牌：</th>
				             <td>
				                 <input type="text" id="clpp1" name="clpp1"  value="${list.clpp1 }"/>
				             </td>
				             <th align="right" height="26">号牌种类：</th>
				             <td>
				                 <input type="text" id="hpzl" name="hpzl" class="easyui-combobox " value="${list.hpzl }"
				                        data-options="url:'${ctx}/code/findCodeByCodetype.htm?xtlb=00&dmlb=1007',valueField:'dmz',textField:'dmsm1mc'">
				             </td>
				         </tr>
				     	 <tr>
				             <th align="right" height="26">车外廓长(mm)：</th>
				             <td>
				                 <input type="text" id="wkccmc" name="wkccmc"  value="${list.wkccmc }"/>
				             </td>
				             <th align="right">车辆颜色：</th>
				             <td>
				                 <input type="text" id="csys" name="csys" class=" easyui-combobox"
										data-options="
			                                    url:'${ctx}/code/findCodeByCodetype.htm?xtlb=00&dmlb=1008',
			                                    valueField:'dmz',
			                                    textField:'dmsm1'
			                                " value="${list.csys }"/>
				             </td>
				              <th align="right" height="26">车辆识别编号：</th>
				             <td>
				                 <input type="text" id="clsbdh" name="clsbdh" value="${list.clsbdh }"/>
				             </td>
				         </tr>
				         <tr>
				             <th align="right" height="26">发动机编号：</th>
				             <td>
				                <input type="text" id="fdjh" name="fdjh"  value="${list.fdjh }"/>
				             </td>
				             <th align="right" height="26">所有人：</th>
				             <td>
				                 <input type="text" id="syr" name="syr"  value="${list.syr }"/>
				             </td>
				              <td align="right" height="26">审核：</td>
			                <td><input  id="yxshztSelect" name="yxshztSelect" class="easyui-combobox shurukuangkais " 
								data-options="
								prompt:'请选择审核批复',
								valueField:'value',
								textField:'text',
								panelHeight:'auto',
								editable:false,
								data:[
								{value:'2',text:'审核通过'},
								{value:'3',text:'审核不通过并返回'}]"/>
			              </td>
				         </tr>
				    </table>
				    </div>
				    <div data-options="region:'center',border:false" id="tpStyle">				    		
				    </div>				    
</div>



</div>

	<div data-options="region:'east',border:false" style="width: 280px;overflow-y :auto;padding: 7px 7px 7px 2px;">
	    	<div class="easyui-layout" data-options="fit:true" style="border:1px solid #d2d2d2;">
				<div data-options="region:'center',border:false">
					<input type="hidden" id="vehicleXh" value="${list.xh }"/>
					<input type="hidden" id="startTime" value="${startTime }"/>
					<input type="hidden" id="endTime" value="${endTime }"/>
					<input type="hidden" id="hphmFlag" value="${hphm }"/>
					<input type="hidden" id="hpzlFlag" value="${hpzl }"/>
					<input type="hidden" id="yxztFlag" value="${yxzt }"/>
							<p class="shipingjiemiangtanggr_top">
								采集记录
							</p>
							<ul class="shipingjiemiangtanggr_bottom" id="yxxxinfo">
							</ul>
				</div>
				<div data-options="region:'south',border:false" style="height: 60px;">    	            	              
	             
							 <div class="diyipaidhusnfhenfnf1">             	            
				             </div> 
				             <div class="diyipaidhusnfhenfnf1">
				                  <a id="saveId" href="#" style=" float: right;" class="congzhim" onClick="javascript:VerifyAndSave();" style="visibility: visible;">确认审核</a>	             	            
	             				  <a id="nextId" href="#" style=" float: right;" class="congzhim" onClick="javascript:GoToNextPage();" style="visibility: visible;">下一条</a>	             
	         	 				  <a id="preId" href="#" class="congzhim" style=" float: right; margin: 0 15px 0 0 ;" onClick="javascript:GoToPrePage();" style="visibility: visible;">上一条</a>    
				           </div> 
				</div>
			</div>

	    </div>
	    </form> 
</body>
<script type="text/javascript">
var pageIndex=0;
var pageSize=1;
var pageTotal=0;
function GoToPrePage() {
    pageIndex -= 1;
    pageIndex = pageIndex >= 1 ? pageIndex : 1;
    AjaxGetData(pageIndex, pageSize);
}

function GoToNextPage() {
        pageIndex += 1;
        AjaxGetData(pageIndex, pageSize);
}
function AjaxGetData(index,size) {
	var startTime = $("#startTime").val();
	var endTime = $("#endTime").val();
	var hphm = encodeURI(encodeURI($("#hphmFlag").val()));
	var hpzl = $("#hpzlFlag").val();
	 $.ajax({
         url: "${ctx}/yxxx/findYxshByxhUpAndDown.htm",
         type: "get",
         data: "page=" + pageIndex + "&pageSize=" + pageSize+"&hphm="+hphm+
        		"&hpzl="+hpzl+"&startTime="+startTime+"&endTime="+endTime,
         dataType: "json",
         success:function(data){
	         //check(data.rows[0].tpurl);
	         judgePrePage(data.page);
	         judgeNextPage(index,pageTotal);
        	 $("#gclsForm").form('load',data.rows[0]); 
        	 showYxxxList(data.rows[0].xh);
         }
	 });
}
  $(function () {  
    pageIndex=parseInt('${page.page}');
    pageTotal=parseInt('${page.totalPages}');
    //check('${list.tpurl}');
    judgePrePage(pageIndex);
    judgeNextPage(pageIndex,pageTotal);
   // AjaxGetData(pageIndex, pageSize);
   	showYxxxList($("#vehicleXh").val());

});  
  function judgePrePage(index){
	  if(index<=1){
		  $("#preId").removeClass("congzhim").addClass("congzhim1");
		  $("#preId").removeAttr("onclick");
	  }else{
		  $("#preId").removeClass("congzhim1").addClass("congzhim");
		  $("#preId").attr("onclick","GoToPrePage();");
	  }
  }
  function judgeNextPage(index,pageTotal){
	  if(index>=pageTotal){
		  $("#nextId").removeClass("congzhim").addClass("congzhim1");
		  $("#nextId").removeAttr("onclick");
	  }else{
		  $("#nextId").removeClass("congzhim1").addClass("congzhim");
		  $("#nextId").attr("onclick","GoToNextPage();");
	  }
  }
  
  function showYxxxList(vehicleXh) {
		$.ajax({
			type:'POST',
			url:'${ctx}/yxxx/findYxshRelation.htm',
			data:{xh:vehicleXh},
			dataType:'json',
			success:function(data, textStatus, jqXHR){
				changeSrc(data[0].tpurl);
				$("#yxxxinfo").html("");
				var tableBodyStr = "";
				  if(data==""){
				      tableBodyStr+="<p class=\"xiangguanxinxzhifjiluyi1\" style=\"border:none;width:200px\">没有符合条件的查询结果！</p>";
				    }else{			    	
				      $.each(data,function(i,n){				    	  
						if (n.tpurl != "") {
							var str = n.tpurl;
							
							tableBodyStr += "<li>";
							//tableBodyStr += "<input type=\"checkbox\" name=\"checkbox1\" id=\""+n.tpid+"\" value=\""+n.tpid+"\">";
							tableBodyStr += "<img  onerror=\"javascript:this.src='${ctx}/images/tupiangsd.png'\" src=\""+str+"\" width=\"100%\" height=\"100\" style=\"float: left; margin: 0 5px 0 0;\" onclick=\"javascript:changeSrc(this.src)\"/>";
							tableBodyStr += "</li>";
						}else{
							tableBodyStr += "<li>";
							tableBodyStr += "<img onerror=\"javascript:this.src='${ctx}/images/tupiangsd.png'\" width=\"100%\" height=\"100\" style=\"float: left; margin: 0 10px 0 0;\" onclick=\"javascript:changeSrc()\"/>";
							tableBodyStr += "</li>";
						}
				      });
				    }
				$("#yxxxinfo").html(tableBodyStr);
			},
			error:function(XMLHttpRequest, textStatus, errorThrown){
				
			}
		});
	}
  function changeSrc(srcValue){
		var playPic = "";
		$("#tpStyle").html("");
		playPic +="<img id=\"imggc\" onerror=\"javascript:this.src='${ctx}/images/wutuffs.png'\" src=\""+srcValue+"\"  style=\"width:90%;height:100%\">"; 
		$("#tpStyle").html(playPic);
	}
  
  function VerifyAndSave(){
  		var yxshzt=$("#yxshztSelect").combobox('getValue');
  		var xh=$("#vehicleXh").val();
  		if(yxshzt==""){
  			alert("请选择审核批复");
  			return;
  		}
  		$.ajax({
			type:'POST',
			url:'${ctx}/yxxx/updateYxshzt.htm',
			data:{xh:xh,
				  yxzt:yxshzt},
			dataType:'json',
			success:function(data,textStatus,jqXHR){
				if(data==true){
					alert("审核成功");
					
					GoToNextPage();
					$('#yxshztSelect').combobox('clear');
				}else{
					alert("审核失败");
				}
			}
  		});
  	}
</script>
</html>